package engine.physics;

import engine.entities.Entity;
import engine.entities.Spatial;

public class Friction implements PhysicsResolver {
	/*
	 * TODO il valore di frizione deve essere proprio del terreno???
	 */

	@Override
	public void updatePhysics(Entity e, float delta) {
		Spatial spatial = e.getSpatial();
		float speed = spatial.getSpeedX();
		float y = spatial.getY();

		if (speed != 0 && y == 0)
			spatial.setSpeedX(speed * 4 / 5 * delta);
	}

}
